package com.demo.enums;

/**
 * 系统模块分类枚举
 * 
 *
 */
public enum ModuleType implements BaseEnum<ModuleType> {

    NONE(-1, "错误"),
    WEB(1, "Web平台"),
    APP(2, "App手机"),
    MICROAPP(3, "小程序");

    private int code;

    private String message;

    private ModuleType(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public static ModuleType parse(int code) {
        for (ModuleType st : ModuleType.values()) {
            if (st.getCode() == code) {
                return st;
            }
        }
        return NONE;
    }

}
